package com.caigou.service.impl;

import com.caigou.bean.cms.entity.AuditData;
import com.caigou.bean.cms.param.ArticleListParam;
import com.caigou.mapper.cms.AuditDataMapper;
import com.caigou.pojo.OperatingRecordData;
import com.caigou.service.AuditDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("auditDataService")
@Slf4j
public class AuditDataServiceImpl implements AuditDataService {

    @Resource
    private AuditDataMapper auditDataMapper;

    @Override
    public int saveAuditData(String userId, String articleId, Integer actionType, String articleStatus) {
        AuditData auditData = new AuditData();
        auditData.setUserId(userId);
        auditData.setDataId(articleId);
        auditData.setActionType(actionType);
        auditData.setInfo(articleStatus);
        return auditDataMapper.saveAuditData(auditData);
    }

    @Override
    public List<OperatingRecordData> loadOperatingRecordDataList(ArticleListParam param) {
        return auditDataMapper.loadOperatingRecordDataList(param);
    }
}
